package cn.e_eap.esite.bean;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

@Entity(name="module")
public class Module {
	private List<Module> children;
	
	private String name;
	
	private int id;
	
	private String params;
	
	private int level=1;
	
	private Module parent;
	
	private String sn;
	
	private String target;
	
	private String url;
	
	private String type;

	@OneToMany(mappedBy="parent", cascade=CascadeType.ALL)
	public List<Module> getChildren() {
		return children;
	}

	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}

	public String getParams() {
		return params;
	}

	@ManyToOne
	public Module getParent() {
		return parent;
	}

	public String getSn() {
		return sn;
	}

	public String getTarget() {
		return target;
	}

	public String getUrl() {
		return url;
	}

	public void setChildren(List<Module> children) {
		this.children = children;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setParams(String params) {
		this.params = params;
	}

	public void setParent(Module parent) {
		this.parent = parent;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	public void setTarget(String target) {
		this.target = target;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	
}
